package top.kaoshanji.p1ch04a;

/**
 * 代码清单-p1ch04a-053页a：给方法传递对象，可能并不是你所理解的那样
 * author kaoshanji
 * ^_^
 * create time 2025/3/6 16:44
 */
public class PassObject {

    static void f(Letter y) {
        y.c = 'z';
    }

    public static void main(String[] args) {

        Letter x = new Letter();
        x.c = 'a';
        System.out.println("1: x.c: " + x.c);

        f(x);
        System.out.println("2: x.c: " + x.c); // 为啥不是 a 
    }


}

class Letter {
    char c;
}
